#include"comm.h"


int main()
{
	int shm_id=creat_shm(4096);
	int sem_id=creat_sem(1);
	int ret=init_sem(sem_id,0);
	char *server=at_shm(shm_id);
	printf("%d\n",4090);
	while(1)
	{
		p_sem_op(sem_id,0);
		if(server[0]!='\0')
		{
		printf("client:%s",server);
		}
		printf("pleasr write to client:");
		fflush(stdout);
		memset(server,'\0',4090);
		int size=read(0,server,4090);
		if(size>0)
		{
				server[size]='\0';
		}
		v_sem_op(sem_id,0);
	}
	distroy_shm(shm_id);
	return 0;
}
